#include <iostream>
#include <string>
#include <cstring>

using namespace std;

class My_string
{
private:
    char buf[128];
public:
    My_string(){}
    ~My_string(){}
    My_string(char *buf)
    {
        if (buf == NULL)
        {
            cout << "buf == null" << endl;
            return;
        }

        strcpy(this->buf, buf);
    }

public:
    void show()
    {
        cout << this->buf << endl;
    }

public:
    // 重载一个 加法运算
    const My_string operator+(const My_string &str_1)
    {
        My_string temp(this->buf);

        strcat(temp.buf, str_1.buf);

        return temp;
    }

    // 关系运算符重载
    bool operator>(My_string & str)
    {
        if (strlen(this->buf) > strlen(str.buf))
        {
            return true;
        }
        return false;
    }

    // 重载一个 左移运算符
    friend ostream &operator<<(ostream &os, My_string &str);
};

// 重载一个 左移运算符
ostream &operator<<(ostream &os, My_string &str)
{
    os << str.buf ;
    return os;
}

int main(int argc, char const *argv[])
{
    My_string S1("张三");
    My_string S2("李四");

    My_string S3 = S1 + S2;

    cout << S3 << endl;


    cout << (S3 > S1) << endl;

    return 0;
}
